package
{
	import flash.display.Sprite;
	import flash.events.Event;
	
	import model.*;
	
	public class VirtualZoo extends Sprite
	{
		private var pet:VirtualPet;
		private var petView:VirtualPetView;
		
		public function VirtualZoo()
		{
			pet = new VirtualPet("Bob");
			petView = new VirtualPetView(pet);
			petView.addEventListener(Event.COMPLETE, petViewCompleteListener);
			
			pet.eat(new Apple());
			pet.eat(new Sushi());
		}
		
		protected function petViewCompleteListener(event:Event):void
		{
			addChild(petView);
			pet.start();
		}
	}
}